package biolabs.util;

import java.util.Iterator;

public class TransformingIterable<I, O> implements Iterable<O>{

	private final Iterable<I> coll;
	private final Transformation<I,O> tr;
	
	public TransformingIterable(Iterable<I> coll, Transformation<I,O> tr){
		this.coll = coll;
		this.tr = tr;
	}

	@Override
	public Iterator<O> iterator() {
		return new TransformingIterator<I,O>(coll.iterator(), tr);
	}	
}